package com.spa.infrastructure.service.storage;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class FileService {

    @Autowired
    private FileStorageContext fileStorageContext;

    public String getUrl(String key, StorageType storageType) {
        return fileStorageContext.getFileStorageService(storageType).getUrl(key);
    }

    public String getUploadToken() {
        return fileStorageContext.getFileStorageService(StorageType.QINIUYUN).getUploadToken();
    }

}
